<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 17:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_Airline" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%
    // 获取要删除的航空公司ID
    String aid = request.getParameter("aid");

    // 构建删除操作的输入列表
    List<String> deleteInput = new ArrayList<>();
    deleteInput.add(aid);

    // 创建DB_Airline实例
    DB_Airline dbAirline = new DB_Airline();
    // 执行删除操作
    boolean deleteResult = dbAirline.delete(deleteInput);

    if (deleteResult) {
        // 删除成功，重定向到index.jsp
        response.sendRedirect("index.jsp");
    } else {
        // 删除失败，输出错误信息
        out.println("删除航空公司失败");
    }
%>